package hrm.serviceimple;

import hrm.dao.LanguageDAO;
import hrm.daoimple.LanguageDAOImple;
import hrm.dto.insa.LanguageDTO;
import hrm.service.LanguageService;

import java.util.List;

public class LanguageServiceImple implements LanguageService {
	private LanguageDAO languageDAO;
	private static LanguageServiceImple languageService;
	
	private LanguageServiceImple(){
		languageDAO=new LanguageDAOImple();
	}
	
	public static LanguageServiceImple getInstance(){
		if (languageService==null) {
			languageService=new LanguageServiceImple();
		}
		return languageService;
	}
	
	
	public void setLanguageDAO(LanguageDAO languageDAO) {
		this.languageDAO = languageDAO;
	}


	@Override
	public List<LanguageDTO> getAllLanguage(LanguageDTO dto) {
		return languageDAO.getAllLanguage(dto);
	}


	@Override
	public boolean deleteLanguage(LanguageDTO dto) {
		
		return languageDAO.deleteLanguage(dto);
	}


	@Override
	public boolean insertLanguage(LanguageDTO dto) {

		return languageDAO.insertLanguage(dto);
	}


	@Override
	public boolean updateLanguage(LanguageDTO dto) {

		return languageDAO.updateLanguage(dto);
	}
	
}
